extends ../layout

block css
    link(rel='stylesheet', href='/css/base/ck_base.css', media='screen')
    link(rel='stylesheet', href='/css/user/ck_set.css', media='screen')
block js
    script(src='/js/jquery-1.8.0.min.js')
    script(src='/js/html5.js')
    script(src='/js/jquery.common.js')
    script(src='/js/user/util.js')
block content

    .set_wrap.clearfix
      aside.set_sidebar
        .nav_hd 设置中心
        ul.sidetab
          li
            a.icoR_11(href='/info') 个人资料
          li
            a.icoR_20(href='/info/address') 收货地址
          li
            a.icoR_12(href='/info/icon') 设置头像
          li
            a.icoR_15(href='/info/pwd') 帐号安全
          li.curr
            a.icoR_21(href='/info/school') 所在学校            
      .set_content.accout_safe
        .as_bd.clearfix
          .as_title 学校信息
          .form_con.clearfix
            input#province(type='hidden', value='#{province}')
            input#city(type='hidden', value='#{city}')
            input#zone(type='hidden', value='#{zone}')
            input#cls(type='hidden', value='#{cls}')
            input#school(type='hidden', value='#{school}')
            .l_t #{schoolNmae}
            #cascader_school
            .formItem
              label.form_label(for='')  
              .form_field
                a#saveBtn1.n_btn38g(href='javascript:;') 保存
        // =E grzl_bd
      script(type='text/javascript').
        var data = !{JSON.stringify(_city)};
        var cascader_city = JSON.parse(data);        
        $(function () {
        $("#saveBtn1").click(function () {
        var province = $("#province").val();
        var city = $("#city").val();
        var zone = $("#zone").val();
        var school = $("#school").val();
        var cls = $("#cls").val();
        var params = "province=" + province + "&city=" + city + "&zone=" + zone + "&school=" + school + "&cls=" + cls;
        $.ajax({
        url: "/info/saveSchool",
        type: "post",
        data: params,
        dataType: "json",
        success: function (ret) {
        if (ret.code == 0) {
        $.tipsBoxy({
        type: "success",
        message: "修改成功",
        mask: true,
        width: 300,
        callback: function () {
        document.location.reload();
        }
        });
        } else {
        $.tipsBoxy({type: "error", message: ret.result, mask: true, width: 300});
        }
        }
        });
        });
        });
      script(src='/js/user/school.js')
